package EventHandler
{
	import flash.printing.PrintJob;
	import flash.printing.PrintJobOptions;
	import flash.printing.PrintJobOrientation;
	
	import mx.controls.Image;
	import mx.printing.FlexPrintJob;
	import mx.printing.FlexPrintJobScaleType;
	
	import spark.components.Group;
	
	public class PrintFormSvet
	{
		public function PrintFormSvet(printee:Group)
		{
			var printJob:PrintJob = new PrintJob();
			var originalRotation:Number = printee.rotation;
			printJob.start();
			if (printJob.orientation == PrintJobOrientation.PORTRAIT) 
			{ 
				printee.rotation = 90;
			}
			var printOptions:PrintJobOptions = new PrintJobOptions();
			trace(printOptions.printAsBitmap);
			printOptions.printAsBitmap = true; 
			printJob.addPage(printee,null,printOptions);
			printJob.send();
			
			printee.rotation = originalRotation;
		}

		public function FlexPrintFormSvet(myObject:Group):void
		{
			var printJob:FlexPrintJob = new FlexPrintJob();
			printJob.start();
			printJob.addObject(myObject, FlexPrintJobScaleType.MATCH_WIDTH);
			
			printJob.send();
			
		}
	}
}